.class Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;
.super Landroid/inputmethodservice/Keyboard$Key;
.source "LatinKeyboard.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/inputmethod/latin/LatinKeyboard;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = "LatinKey"
.end annotation


# static fields
.field public static final DRAWABLE_STATE_ACTIVATE:I = 0x10100a2

.field public static final DRAWABLE_STATE_PRESSED:I = 0x10100a7

.field private static final KEY_STATE_NORMAL_ACTIVE:[I

.field private static final KEY_STATE_PRESSED_ACTIVE:[I


# instance fields
.field private mShiftLockEnabled:Z


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 198
    const/4 v0, 0x2

    new-array v0, v0, [I

    fill-array-data v0, :array_0

    sput-object v0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->KEY_STATE_PRESSED_ACTIVE:[I

    .line 202
    const/4 v0, 0x1

    new-array v0, v0, [I

    const/4 v1, 0x0

    const v2, 0x10100a2

    aput v2, v0, v1

    sput-object v0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->KEY_STATE_NORMAL_ACTIVE:[I

    return-void

    .line 198
    :array_0
    .array-data 0x4
        0xa2t 0x0t 0x1t 0x1t
        0xa7t 0x0t 0x1t 0x1t
    .end array-data
.end method

.method public constructor <init>(Landroid/content/res/Resources;Landroid/inputmethodservice/Keyboard$Row;IILandroid/content/res/XmlResourceParser;)V
    .locals 1
    .parameter "res"
    .parameter "parent"
    .parameter "x"
    .parameter "y"
    .parameter "parser"

    .prologue
    .line 210
    invoke-direct/range {p0 .. p5}, Landroid/inputmethodservice/Keyboard$Key;-><init>(Landroid/content/res/Resources;Landroid/inputmethodservice/Keyboard$Row;IILandroid/content/res/XmlResourceParser;)V

    .line 211
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->popupCharacters:Ljava/lang/CharSequence;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->popupCharacters:Ljava/lang/CharSequence;

    invoke-interface {v0}, Ljava/lang/CharSequence;->length()I

    move-result v0

    if-nez v0, :cond_0

    .line 213
    const/4 v0, 0x0

    iput v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->popupResId:I

    .line 215
    :cond_0
    return-void
.end method

.method private isEnterKey(I)Z
    .locals 1
    .parameter "code"

    .prologue
    .line 248
    const/16 v0, 0xa

    if-ne p1, v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private isShiftKey(I)Z
    .locals 1
    .parameter "code"

    .prologue
    .line 252
    const/4 v0, -0x1

    if-ne p1, v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method enableShiftLock()V
    .locals 1

    .prologue
    .line 218
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->mShiftLockEnabled:Z

    .line 219
    return-void
.end method

.method public getCurrentDrawableState()[I
    .locals 3

    .prologue
    .line 261
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->codes:[I

    const/4 v2, 0x0

    aget v0, v1, v2

    .line 262
    .local v0, code:I
    invoke-direct {p0, v0}, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->isShiftKey(I)Z

    move-result v1

    if-nez v1, :cond_2

    .line 263
    if-ltz v0, :cond_0

    invoke-direct {p0, v0}, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->isEnterKey(I)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 264
    :cond_0
    iget-boolean v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->pressed:Z

    if-eqz v1, :cond_1

    .line 265
    sget-object v1, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->KEY_STATE_PRESSED_ACTIVE:[I

    .line 271
    :goto_0
    return-object v1

    .line 267
    :cond_1
    sget-object v1, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->KEY_STATE_NORMAL_ACTIVE:[I

    goto :goto_0

    .line 271
    :cond_2
    invoke-super {p0}, Landroid/inputmethodservice/Keyboard$Key;->getCurrentDrawableState()[I

    move-result-object v1

    goto :goto_0
.end method

.method public isInside(II)Z
    .locals 5
    .parameter "x"
    .parameter "y"

    .prologue
    const/4 v4, -0x1

    const/4 v3, -0x5

    .line 235
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->codes:[I

    const/4 v2, 0x0

    aget v0, v1, v2

    .line 236
    .local v0, code:I
    if-eq v0, v4, :cond_0

    if-ne v0, v3, :cond_3

    .line 238
    :cond_0
    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->height:I

    div-int/lit8 v1, v1, 0xa

    sub-int/2addr p2, v1

    .line 239
    if-ne v0, v4, :cond_1

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->width:I

    div-int/lit8 v1, v1, 0x6

    add-int/2addr p1, v1

    .line 240
    :cond_1
    if-ne v0, v3, :cond_2

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->width:I

    div-int/lit8 v1, v1, 0x6

    sub-int/2addr p1, v1

    .line 244
    :cond_2
    :goto_0
    invoke-super {p0, p1, p2}, Landroid/inputmethodservice/Keyboard$Key;->isInside(II)Z

    move-result v1

    return v1

    .line 241
    :cond_3
    const/16 v1, 0x20

    if-ne v0, v1, :cond_2

    .line 242
    sget v1, Lcom/android/inputmethod/latin/LatinKeyboard;->sSpacebarVerticalCorrection:I

    add-int/2addr p2, v1

    goto :goto_0
.end method

.method public onReleased(Z)V
    .locals 1
    .parameter "inside"

    .prologue
    .line 223
    iget-boolean v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->mShiftLockEnabled:Z

    if-nez v0, :cond_0

    .line 224
    invoke-super {p0, p1}, Landroid/inputmethodservice/Keyboard$Key;->onReleased(Z)V

    .line 228
    :goto_0
    return-void

    .line 226
    :cond_0
    iget-boolean v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->pressed:Z

    if-nez v0, :cond_1

    const/4 v0, 0x1

    :goto_1
    iput-boolean v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$LatinKey;->pressed:Z

    goto :goto_0

    :cond_1
    const/4 v0, 0x0

    goto :goto_1
.end method
